/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Exercicio5;

/**
 *
 * @author Pedro
 */
public abstract class Motor {

    protected String nomeMotor;
    public static TipoMotor tipo;
    private static Motor _instancia;

    public static Motor getInstance() {
        if (_instancia == null) {

            switch (tipo) {
                case MotorAco:
                    _instancia = new MotorDeAco();
                    break;
                case MotorAluminio:
                     _instancia = new MotorDeAluminio();
                    break;
                case MotorTitanio:
                     _instancia = new MotorDeTitanio();
                    break;
            }
        }

        return _instancia;

    }

    protected Motor() {
    }

    public abstract void exibeInformacoes();
}
